<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/tag/localeTag.tld" prefix="t"%>
<script src="resources/js/qanda.js"></script>
<!-- 
<script src="resources/js/login.js"></script>
<script src="resources/js/i18n.js"></script> -->
<div class="header">
	<div class="row">
		<div class="col-xs-3 ">
			<div class="col-xs-6 text-left">
				<a href="pmain"><img src="resources/images/logononvector.png" height="35" /> </a>
			</div>
			<div class="col-xs-6 text-left">
				<form action="i18n" method="GET" id="i18n">
					<img src="resources/images/uk.png" height="20" onclick="changeLang('uk')" /> <img src="resources/images/be.png" height="20" onclick="changeLang('be')" /> <img src="resources/images/en.png"
						height="20" onclick="changeLang('en')"
					/>
					<input type="hidden" name="lang" id="lang">
				</form>
			</div>
		</div>
		<div class="col-xs-5 text-center">
			<form action="find">
				<div class="input-group">
					<input type="text" class="form-control" id="findText" name="findText">
					<span class="input-group-btn">
						<button class="btn btn-info" type="submit">
							<span class="glyphicon glyphicon-search"></span>
							<t:locale mName="header.search" />
						</button>
					</span>
				</div>
			</form>
		</div>
		<div class="col-xs-1 text-right">
			<c:if test="${user.status==true}">
				<h4>
					<span class="label label-danger">
						<span class="glyphicon glyphicon-lock"></span>
						<t:locale mName="header.banned" />
					</span>
				</h4>
			</c:if>
		</div>
		<c:choose>
			<c:when test="${empty user}">
				<div class="col-xs-3 text-right">
					<span id="loginButton">
						<span class="btn btn-info">
							<t:locale mName="header.signIn" />
						</span>
					</span>
					<div id="loginBox" class="text-left">
						<form id="loginForm" action="login" method="POST">
							<div class="form-group">
								<label for="userLogin">
									<t:locale mName="header.login" />
								</label>
								<input type="text" class="form-control" id="userLogin" placeholder="<t:locale mName="header.login"/>" onkeydown="if (event.keyCode == 13) document.getElementById('logButton').click()">
							</div>
							<div class="form-group">
								<label for="userPassword">
									<t:locale mName="header.password" />
								</label>
								<input type="password" class="form-control" id="userPassword" placeholder="<t:locale mName="header.password"/>"
									onkeydown="if (event.keyCode == 13) document.getElementById('logButton').click()"
								>
							</div>
							<span class="loginStatus"></span>
							<input type="button" onclick="log()" class="btn btn-info" value="<t:locale mName="header.signIn"/>" id="logButton">
							<a href="forgotPasswordPage"><t:locale mName="header.forgotPassword" /></a>
						</form>
					</div>
					<a href="preg"> <input type="submit" class="btn btn-info" value="<t:locale mName="header.registration"/>"></a>
				</div>
			</c:when>
			<c:otherwise>
				<div class="col-xs-3 text-right">
					<a href="paccount"> <span class="btn btn-info">
							<span class="glyphicon glyphicon-user"></span>
							<t:locale mName="header.account" />
						</span></a> <a href="logout"> <span class="btn btn-info">
							<t:locale mName="header.logout" />
							, ${user.login}
						</span></a>
				</div>
			</c:otherwise>
		</c:choose>
	</div>
</div>
